<#assign EntityMapperUtils = statics["top.cardone.generator.code.util.EntityMapperUtils"]>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="http://www.springframework.org/schema/beans"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
       default-lazy-init="true">
    <!-- ${businessName} -->
    <bean id="${packageCode}.${moduleMapperCode}.dao.${businessCode}Dao"
          class="${packageCode}.${moduleMapperCode}.dao.${businessCode}JdbcDao">
        <property name="configTable">
            <map>
                <entry key="config">
                    <map>
                        <entry key="sqlFileRoot" value="/${projectCode!}/${moduleMapperCode}/${businessCode?uncap_first}/"/>
                    <#if entityMapper??>
                        <entry key="pks" value="${EntityMapperUtils.getPks(entityMapper)!''}"/>
                        <entry key="codes" value="${EntityMapperUtils.getPks(entityMapper)!''}"/>
                    </#if>
                    </map>
                </entry>
            <#if entityMapper??>
                <entry key="insert">
                    <map>
                        <entry key="${EntityMapperUtils.getPks(entityMapper)!''}" value="getRandomUUIDFunc"/>
                        <entry key="creator" value="getLoginUserIdFunc"/>
                        <entry key="createDate" value="getNowDateFunc"/>
                    </map>
                </entry>
                <entry key="update">
                    <map>
                        <entry key="modifier" value="getLoginUserIdFunc"/>
                        <entry key="modifyDate" value="getNowDateFunc"/>
                    </map>
                </entry>
            </#if>
            </map>
        </property>
    </bean>

    <!-- ${businessName} -->
    <bean id="${packageCode}.${moduleMapperCode}.service.${businessCode}Service"
          class="${packageCode}.${moduleMapperCode}.service.${businessCode}DefaultService">
        <property name="dao" ref="${packageCode}.${moduleMapperCode}.dao.${businessCode}Dao"/>
    </bean>

    <bean parent="messageListenerContainerParnet">
        <property name="messageListener">
            <bean  parent="exceptionParnet">
                <property name="serviceInterface" value="${packageCode}.${moduleMapperCode}.service.${businessCode}Service"/>
                <property name="service" ref="${packageCode}.${moduleMapperCode}.service.${businessCode}Service"/>
            </bean>
        </property>
        <property name="destination">
            <bean class="org.apache.activemq.command.ActiveMQQueue">
                <constructor-arg value="${packageCode}.${moduleMapperCode}.service.${businessCode}Service"/>
            </bean>
        </property>
    </bean>
</beans>